<template>
  <div>
    <a-card :bordered="false">
      <a-tabs :ActiveKey="keyVal" @change="callback">
        <a-tab-pane key="1" tab="基本信息">
          <!-- 主表单区域 -->
          <div class="btn">
            <a-button v-if="!states" type="primary" @click="add">保存</a-button>
            <a-button v-if="!states" type="primary" @click="reset">重置</a-button>
          </div>
          <a-form :form="form">
            <a-row>
              <a-col :xs="24" :sm="8">
                <!-- <a-form-item label="全宗号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    v-decorator="['quanZongHao', validatorRules.quanZongHao]"
                    placeholder="请输入全宗号"
                    :disabled=type
                    
                  ></a-input>
                </a-form-item>-->
                <a-form-item label="全宗号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states"
                    @click.native="showModalQZ"
                    v-decorator="[
                  'quanZongHao',
                  {
                    rules: [
                      {
                        required: true,
                        message: '全宗号不能为空'
                      }
                    ]
                  }
                ]"
                    placeholder="请输入全宗号"
                  ></a-input>
                </a-form-item>
                <a-modal
                  centered
                  title="全宗号"
                  :visible="visibleQZ"
                  @ok="handleOkQZ"
                  @cancel="handleCancelQZ"
                  width="900px"
                >
                  <a-row :gutter="24">
                    <div class="table-page-search-wrapper">
                      <a-form layout="inline">
                        <a-row :gutter="24">
                          <a-col :span="14">
                            <a-form-item label="全宗名称">
                              <a-input placeholder="请输入" v-model="searchQZ" />
                            </a-form-item>
                          </a-col>
                          <a-col :span="8">
                            <span
                              style="float: left;overflow: hidden;"
                              class="table-page-search-submitButtons"
                            >
                              <a-button type="primary" icon="search" @click.native="search()">查询</a-button>
                              <a-button
                                type="primary"
                                icon="reload"
                                @click.native="resets()"
                                style="margin-left: 8px"
                              >重置</a-button>
                            </span>
                          </a-col>
                        </a-row>
                      </a-form>
                    </div>
                    <a-table
                      bordered
                      rowKey="id"
                      :columns="columnsQZ"
                      :dataSource="dataQZ"
                      :loading="loading"
                      :pagination="false"
                    >
                      <template slot="action" slot-scope="text, record">
                        <a @click="() => seve(record)">选择</a>
                      </template>
                    </a-table>
                    <a-pagination
                      style="margin-top:20px;float:right"
                      showQuickJumper
                      :defaultCurrent="1"
                      :total="total"
                      @change="onChangeQZ"
                    />
                  </a-row>
                </a-modal>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="流水号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="true"
                    style="width: 100%"
                    v-decorator="['wenDangXuHao']"
                    id="inputNumber"
                    placeholder="请输入流水号"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="年度" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <!-- <a-input-number
                   :disabled=type
                    style="width: 100%"
                    id="inputNumber"
                    placeholder="请输入年度"
                    v-decorator="['nianDu', validatorRules.nianDu]"
                  />-->
                  <j-dict-select-tag
                    :disabled="states||circulationStatus"
                    placeholder="请选择年度"
                    type="list"
                    v-decorator="['nianDu', validatorRules.nianDu]"
                    :trigger-change="true"
                    dictCode="NianDu"
                  />
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="档号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input :disabled="true" v-decorator="['dangHao']" placeholder="请输入档号"></a-input>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="保管期限" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <j-dict-select-tag
                    :disabled="states||circulationStatus"
                    type="list"
                    v-decorator="['baoGuanQiXian', validatorRules.baoGuanQiXian]"
                    :trigger-change="true"
                    dictCode="BaoGuanQiXian"
                    placeholder="请选择保管期限"
                  />
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="归档日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <j-date
                    :disabled="states"
                    placeholder="请选择日期"
                    v-decorator="['riQi', validatorRules.riQi]"
                    :trigger-change="true"
                    style="width: 100%"
                  />
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="归档机构" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <j-select-depart
                    :disabled="states||circulationStatus"
                    v-decorator="['guiDangJiGou', validatorRules.guiDangJiGou]"
                    :trigger-change="true"
                    :multi="true"
                  ></j-select-depart>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="立档单位名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <!-- <a-input
                    v-decorator="['liDangDnWeiMingCheng', validatorRules.liDangDnWeiMingCheng]"
                    placeholder="请输入立档单位名称"
                  ></a-input>-->
                  <j-select-depart
                    :disabled="states"
                    v-decorator="[
                  'liDangDnWeiMingCheng',
                  {
                    rules: [
                      {
                        required: true,
                        message: '请选择立档单位'
                      }
                    ]
                  }
                ]"
                    :trigger-change="true"
                    :multi="true"
                  ></j-select-depart>
                </a-form-item>
              </a-col>

              <a-col :xs="24" :sm="8">
                <a-form-item label="关键词" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states"
                    v-decorator="['guanJianCi', validatorRules.guanJianCi]"
                    placeholder="请输入关键词"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="责任者" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states"
                    v-decorator="['zeRenZhe', validatorRules.zeRenZhe]"
                    placeholder="请输入责任者"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="起止页号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states"
                    v-decorator="['yeHao', validatorRules.yeHao]"
                    placeholder="请输入起止页号"
                  ></a-input>
                </a-form-item>
              </a-col>

              <a-col :xs="24" :sm="8">
                <a-form-item label="主题词" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states"
                    v-decorator="['zhuTiCi', validatorRules.zhuTiCi]"
                    placeholder="请输入主题词"
                  ></a-input>
                </a-form-item>
              </a-col>
              <!-- 录入人不展示-->
              <a-col :xs="24" :sm="8">
                <a-form-item label="机构或问题" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states"
                    v-decorator="['jiGOuHuoWenTi', validatorRules.jiGOuHuoWenTi]"
                    placeholder="请输入机构或问题"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="目录号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states||circulationStatus"
                    v-decorator="['muLuHao', validatorRules.muLuHao]"
                    placeholder="请输入目录号"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="题名" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states"
                    v-decorator="['tiMing', validatorRules.tiMing]"
                    placeholder="请输入题名"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="文种" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <j-dict-select-tag
                    :disabled="states"
                    type="list"
                    v-decorator="['wenZhong', validatorRules.wenZhong]"
                    :trigger-change="true"
                    dictCode="WenZhong"
                    placeholder="请选择文种"
                  />
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="文号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input
                    :disabled="states"
                    style="width: 100%"
                    v-decorator="['wenJianBianHao', validatorRules.wenJianBianHao]"
                    placeholder="请输入文号"
                  ></a-input>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="紧急程度" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <j-dict-select-tag
                    :disabled="states"
                    type="list"
                    v-decorator="['jinJiChengDu', validatorRules.jinJiChengDu]"
                    :trigger-change="true"
                    dictCode="JingJiChengDu"
                    placeholder="请选择紧急程度"
                  />
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="密级" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <j-dict-select-tag
                    :disabled="states||circulationStatus"
                    type="list"
                    v-decorator="['miJi', validatorRules.miJi]"
                    :trigger-change="true"
                    dictCode="MiJi"
                    placeholder="请选择密级"
                  />
                </a-form-item>
              </a-col>

              <!-- 成文日期==归档日期 -->

              <a-col :xs="24" :sm="8">
                <a-form-item label="页数" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input-number
                    :disabled="states"
                    v-decorator="['yeShu', validatorRules.yeShu]"
                    placeholder="请输入页数"
                    style="width: 100%"
                  />
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="8">
                <a-form-item label="件数" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-input-number
                    :disabled="states"
                    v-decorator="['jianShu', validatorRules.jianShu]"
                    placeholder="请输入件数"
                    style="width: 100%"
                  />
                </a-form-item>
              </a-col>
              <!--
              <a-col :xs="24" :sm="8">
                <a-form-item label="聚合层次" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <j-dict-select-tag
                    type="list"
                    v-decorator="['juHeCengCi']"
                    :trigger-change="true"
                    dictCode="JuHeChengCi"
                    placeholder="请选择聚合层次"
                  />
                </a-form-item>
              </a-col>
              
          <a-col :xs="24" :sm="8">
            <a-form-item label="来源" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['laiYuan']" placeholder="请输入来源"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="档案馆名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['dangAnGuanMingCheng']" placeholder="请输入档案馆名称"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="档案馆代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['dangAnGuanDaiMa']" placeholder="请输入档案馆代码"></a-input>
            </a-form-item>
          </a-col> 
          <a-col :xs="24" :sm="8">
            <a-form-item label="电子文件号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['dianZiWenJianHao']" placeholder="请输入电子文件号"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="全宗名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['quanZongMingCheng']" placeholder="请输入全宗名称"></a-input>
            </a-form-item>
          </a-col>
               <a-col :xs="24" :sm="8">
            <a-form-item label="类别号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['leiBeiHao']" placeholder="请输入类别号"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="室编案卷号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['shiBianAnJuanHao']" placeholder="请输入室编案卷号"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="管编案卷号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['guanBianAnJuanHao']" placeholder="请输入管编案卷号"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="室编件号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['shiBianJianHao']" placeholder="请输入室编件号"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="馆编件号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['guanBianJuanHao']" placeholder="请输入馆编件号"></a-input>
            </a-form-item>
          </a-col>
          
          
          <a-col :xs="24" :sm="8">
            <a-form-item label="内容描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['neiRongMiaoShu']" placeholder="请输入内容描述"></a-input>
            </a-form-item>
          </a-col>
          
          <a-col :xs="24" :sm="8">
            <a-form-item label="并列题名" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['bingLieTiMing']" placeholder="请输入并列题名"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="副题名" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['fuTiMing']" placeholder="请输入副题名"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="说明题名文字" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['shuoMingTiMingWenZi']" placeholder="请输入说明题名文字"></a-input>
            </a-form-item>
          </a-col>
          
          
          <a-col :xs="24" :sm="8">
            <a-form-item label="人名" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['renMing']" placeholder="请输入人名"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="摘要" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['zhaiYao']" placeholder="请输入摘要"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="分类号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['fenLeiHao']" placeholder="请输入分类号"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="主送" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['zhuSong']" placeholder="请输入主送"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="抄送" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['chaoSong']" placeholder="请输入抄送"></a-input>
            </a-form-item>
          </a-col>
          
          <a-col :xs="24" :sm="8">
            <a-form-item label="保密期限" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag type="list" v-decorator="['baoMiQiXian']" :trigger-change="true" dictCode="BaoMiQiXian" placeholder="请选择保密期限"/>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="形式特征" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['xingShiTeZheng']" placeholder="请输入形式特征"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="文件组合类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input-number v-decorator="['wenJianZuHeLeiXing']" placeholder="请输入文件组合类型" style="width: 100%"/>
            </a-form-item>
          </a-col>
         
          
          <a-col :xs="24" :sm="8">
            
            <a-form-item label="语种" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag type="list" v-decorator="['yuZhong']" :trigger-change="true" dictCode="yuZhong" placeholder="请输入语种"/>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="稿本" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['gaoBen']" placeholder="请输入稿本"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="权限管理" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['quanXianGuanLi']" placeholder="请输入权限管理"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="知识产权说明" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['zhiShiChanQuanShuoMing']" placeholder="请输入知识产权说明"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="授权对象" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['shouQuanDuiXiang']" placeholder="请输入授权对象"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="授权行为" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['shouQuanXingWei']" placeholder="请输入授权行为"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xs="24" :sm="8">
            <a-form-item label="控制标识" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input v-decorator="['kongZhiBiaoShi']" placeholder="请输入控制标识"></a-input>
            </a-form-item>
          </a-col>
              -->
            </a-row>
          </a-form>
        </a-tab-pane>
        <a-tab-pane key="2" tab="正文" force-render>
          <textList></textList>
        </a-tab-pane>
        <a-tab-pane key="3" tab="关联">
          <relation @func="getMsgFormSon"></relation>
        </a-tab-pane>
        <a-tab-pane key="4" tab="日志">
          <journal></journal>
        </a-tab-pane>
      </a-tabs>
    </a-card>
  </div>
</template>

<script>

import pick from 'lodash.pick'
import { JeecgListMinxinPost } from '@/mixins/JeecgListMinxinPost'
import '@/assets/less/TableExpand.less'
import { WsEdit, queryById } from '@/api/api'
import JDate from '@/components/jeecg/JDate'
import textList from '@/views/text/wenshu/textList'
import journal from '@/views/text/wenshu/journal'
import relation from '@/views/text/wenshu/relation'
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
import { getAction, postAction } from '@/api/manage'
export default {
  name: 'information',
  mixins: [JeecgListMinxinPost],
  inject: ['reload'],
  components: {
    JDate,
    textList,
    JSelectDepart,
    journal,
    relation,
  },
  data() {
    return {
      infoId: '',
      keyVal: '1',
      visibleQZ: false,
      states: false,
      circulationStatus:false,
      loading: true,
      dataQZ: [],
      searchQZ: '',
      columnsQZ: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          width: 80,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        { title: '全宗名称', dataIndex: 'mingCheng', align: 'center' },
        { title: '全宗号', dataIndex: 'bianMa', align: 'center' },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 120,
          scopedSlots: { customRender: 'action' },
        },
      ],
      total: 0,

      validatorRules: {
        riQi: {
          rules: [{ required: true, message: '请输入日期!' }],
        },
        guanJianCi: {
          rules: [{ required: true, message: '请输入关键词!' }],
        },
        zeRenZhe: {
          rules: [{ required: true, message: '请输入责任者!' }],
        },
        yeHao: {
          rules: [
            { required: true, message: '请输入起止页号!' },
          ],
        },
        zhuTiCi: {
          rules: [{ required: true, message: '请输入主题词!' }],
        },
        jiGOuHuoWenTi: {
          rules: [{ required: true, message: '请输入机构或问题!' }],
        },
        wenZhong: {
          rules: [{ required: true, message: '请选择文中!' }],
        },
        wenJianBianHao: {
          rules: [{ required: true, message: '请输入文号!' }],
        },
        jinJiChengDu: {
          rules: [{ required: true, message: '请选择紧急程度!' }],
        },
        jianShu: {
          rules: [
            { required: true, message: '请输入件数!' },
            { pattern: /^[+]{0,1}(\d+)$/, message: '请输入整数!' },
          ],
        },

        liDangDnWeiMingCheng: {
          rules: [{ required: true, message: '请输入立档单位名称!' }],
        },
        quanZongHao: {
          rules: [{ required: true, message: '请输入全宗号!' }],
        },
        muLuHao: {
          rules: [{ required: true, message: '请输入目录号!' }],
        },
        nianDu: {
          rules: [{ required: true, message: '请输入年度!' }],
        },
        baoGuanQiXian: {
          rules: [{ required: true, message: '请输入保管期限!' }],
        },
        tiMing: {
          rules: [{ required: true, message: '请输入题名!' }],
        },
        miJi: {
          rules: [{ required: true, message: '请输入密级!' }],
        },
        yeShu: {
          rules: [
            { required: true, message: '请输入页数!' },
            { pattern: /^[+]{0,1}(\d+)$/, message: '请输入整数!' },
          ],
        },
        guiDangJiGou: {
          rules: [{ required: true, message: '请输入归档机构!' }],
        },
      },
      form: this.$form.createForm(this),
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },

      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '题号',
          dataIndex: 'actions',
          align: 'center',
          // fixed:"right",
          width: 147,
          scopedSlots: { customRender: 'actions' },
        },
        {
          title: '文号',
          align: 'center',
          dataIndex: 'wenJianBianHao',
        },
        {
          title: '密级',
          align: 'center',
          dataIndex: 'miJi',
        },
        {
          title: '保管期限',
          align: 'center',
          dataIndex: 'baoGuanQiXian',
        },
        {
          title: '年度',
          align: 'center',
          dataIndex: 'nianDu',
        },
        {
          title: '归档机构',
          align: 'center',
          dataIndex: 'guiDangJiGou',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          // fixed:"right",
          width: 147,
          scopedSlots: { customRender: 'action' },
        },
      ],

      url: {
        list: '/wsWenShuDangAnController/gl/queryCorrelationList',
        delete: '/wsWenShuDangAnController/delete',
        deleteBatch: '/wsZhuWenShu/deleteBatch',
        // queryMovingLog:"/wsWenShuDangAnController/lz/queryMovingLog"
      },
    }
  },
  created: function () {
    if (this.$route.query.type == "true"||this.$route.query.type==true) {
      this.states = true
    }
    if(this.$route.query.status=="true"||this.$route.query.status==true){
      this.circulationStatus=true
    }
     this.details()
  },
  methods: {
    // 弹窗
    showModalQZ() {
      this.visibleQZ = true
      this.searchQZ = ''
      getAction(`/xtQuanZong/list`, {
        pageNo: 1,
        pageSize: 5,
      }).then((res) => {
        if (res.success) {
          this.dataQZ = res.result.records
          this.total = res.result.total
          this.loading = false
        }
      })
    },
    // 重置
    resets() {
      this.searchQZ = ''
    },
    // 选择
    seve(record) {
      this.visibleQZ = false
      this.$nextTick(() => {
        this.form.setFieldsValue({
          quanZongHao: record.bianMa,
        })
      })
    },
    // 确定
    handleOkQZ(e) {
      this.visibleQZ = false
    },
    // 取消
    handleCancelQZ(e) {
      this.visibleQZ = false
    },
    // 分页
    onChangeQZ(pageNumber) {
      getAction(`/xtQuanZong/list`, {
        pageNo: pageNumber,
        pageSize: 5,
        mingCheng: this.searchQZ,
      }).then((res) => {
        if (res.success) {
          this.dataQZ = res.result.records
          this.loading = false
        }
      })
    },
    // 查询
    search() {
      getAction(`/xtQuanZong/list`, {
        mingCheng: this.searchQZ,
        pageNo: 1,
        pageSize: 5,
      }).then((res) => {
        if (res.success) {
          this.dataQZ = res.result.records
          this.loading = false
          this.total = res.result.total
        }
      })
    },
    
    getMsgFormSon(val) {},
    callback(key) {
      console.log(key)

      //   if(key!=1&&!this.$route.query.id){
      //   alert("请保存基本信息")
      //   return
      // }
    },
    // 重置
    reset() {
      if (this.$route.query.id) {
        this.reload()
      }else{
        this.form.resetFields()
      }
    },
    // validateError(msg){
    //         this.$message.error(msg)
    //       },
    //      popupCallback(row){
    //        this.form.setFieldsValue(pick(row,'juHeCengCi','laiYuan','dangAnGuanMingCheng','dangAnGuanDaiMa','quanZongMingCheng','liDangDnWeiMingCheng','dianZiWenJianHao','dangHao','quanZongHao','muLuHao','nianDu','baoGuanQiXian','jiGOuHuoWenTi','leiBeiHao','shiBianAnJuanHao','guanBianAnJuanHao','shiBianJianHao','guanBianJuanHao','wenDangXuHao','yeHao','neiRongMiaoShu','tiMing','bingLieTiMing','fuTiMing','shuoMingTiMingWenZi','zhuTiCi','guanJianCi','renMing','zhaiYao','fenLeiHao','wenJianBianHao','zeRenZhe','riQi','wenZhong','jinJiChengDu','zhuSong','chaoSong','miJi','baoMiQiXian','xingShiTeZheng','wenJianZuHeLeiXing','jianShu','yeShu','yuZhong','gaoBen','quanXianGuanLi','zhiShiChanQuanShuoMing','shouQuanDuiXiang','shouQuanXingWei','kongZhiBiaoShi','guiDangJiGou'))
    //      },
    // 详情
    details() {
      if (this.$route.query.id) {
        queryById({
          id: this.$route.query.id,
        }).then((res) => {
          if (res.success) {
            let list = res.result
            setTimeout(() => {
              //  this.form.setFieldsValue(pick(this.mdl, 'note', 'mark'))
              this.form.setFieldsValue({
                quanZongHao: list.quanZongHao,
                wenDangXuHao: list.wenDangXuHao,
                nianDu: list.nianDu,
                dangHao: list.dangHao,
                baoGuanQiXian: list.baoGuanQiXian,
                riQi: list.riQi,
                guiDangJiGou: list.guiDangJiGou,
                liDangDnWeiMingCheng: list.liDangDnWeiMingCheng,
                guanJianCi: list.guanJianCi,
                zeRenZhe: list.zeRenZhe,
                yeHao: list.yeHao,
                zhuTiCi: list.zhuTiCi,
                jiGOuHuoWenTi: list.jiGOuHuoWenTi,
                muLuHao: list.muLuHao,
                tiMing: list.tiMing,
                wenZhong: list.wenZhong,
                wenJianBianHao: list.wenJianBianHao,
                jinJiChengDu: list.jinJiChengDu,
                miJi: list.miJi,
                yeShu: list.yeShu,
                jianShu: list.jianShu,
              })
            }, 100)
          }
        })
      }
    },
    // 添加
    add() {
     
      this.form.validateFields((err, values) => {
        if (!err) {
          let obj = {
            quanZongHao: this.form.getFieldValue('quanZongHao'),
            wenDangXuHao: this.form.getFieldValue('wenDangXuHao'),
            nianDu: this.form.getFieldValue('nianDu'),
            dangHao: this.form.getFieldValue('dangHao'),
            baoGuanQiXian: this.form.getFieldValue('baoGuanQiXian'),
            riQi: this.form.getFieldValue('riQi'),
            guiDangJiGou: this.form.getFieldValue('guiDangJiGou'),
            liDangDnWeiMingCheng: this.form.getFieldValue('liDangDnWeiMingCheng'),
            guanJianCi: this.form.getFieldValue('guanJianCi'),
            zeRenZhe: this.form.getFieldValue('zeRenZhe'),
            yeHao: this.form.getFieldValue('yeHao'),
            zhuTiCi: this.form.getFieldValue('zhuTiCi'),
            jiGOuHuoWenTi: this.form.getFieldValue('jiGOuHuoWenTi'),
            muLuHao: this.form.getFieldValue('muLuHao'),
            tiMing: this.form.getFieldValue('tiMing'),
            wenZhong: this.form.getFieldValue('wenZhong'),
            wenJianBianHao: this.form.getFieldValue('wenJianBianHao'),
            jinJiChengDu: this.form.getFieldValue('jinJiChengDu'),
            miJi: this.form.getFieldValue('miJi'),
            yeShu: this.form.getFieldValue('yeShu'),
            jianShu: this.form.getFieldValue('jianShu'),
          }
          if (this.$route.query.id) {
            obj.id = this.$route.query.id
          }
          WsEdit(obj).then((res) => {
            if (res.success) {
              this.$message.success('保存成功')
              this.infoId = res.result.id
              this.$router.push(this.$route.path + '?id=' + this.infoId)
            }
          })
        }
      })
    },
  },
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.btn {
  width: 100%;
  text-align: right;
  margin: 10px 0;
  .ant-btn {
    margin-right: 30px;
  }
}
</style>
